<!DOCTYPE html>
<html lang="en" manifest="/manifest.appcache">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>{{ page.title }}</title>
    <link rel="alternate" title="{{ site.description }}" type="application/rss+xml" href="/feed.xml">
    <link rel="stylesheet" href="{{ site.baseurl }}/static/css/pouchdb.css" />
    <link rel="me" href="https://fosstodon.org/@pouchdb" />
    <meta name="theme-color" content="#6ccb99">
    <meta name="msapplication-TileColor" content="#6ccb99">
    <script type="text/javascript">
      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', 'UA-42479701-1']);
      _gaq.push(['_trackPageview']);

      (function() {
      var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
      ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
      var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
      })();
    </script>
    <link href='//fonts.googleapis.com/css?family=Lato:400,700|Open+Sans:400,700' rel='stylesheet' type='text/css'>
    <link rel="icon" href="{{ site.baseurl }}/static/favicon.ico" type="image/x-icon"/>
  </head>

  <body data-spy="scroll" data-target="#sidebar">

    <header role="banner">

      <a
        href="https://github.com/apache/pouchdb"
        target="_blank"
        rel="noopener noreferrer"
      >
         <div class="ribbon">GitHub</div>
      </a>

      <div class="container">

        <a class="logo" href="{{ site.baseurl }}/">
          <div class="logo-img"></div>
          <span class='sr-only'>PouchDB</span>
        </a>

        <ul class='nav nav-header nav-pills' role="navigation">
          <li>
            <a class='btn btn-link btn-lg' href="{{ site.baseurl }}/blog/">Blog</a>
          </li>
          <li>
            <a class='btn btn-link btn-lg' href="{{ site.baseurl }}/guides/">Guides</a>
          </li>
          <li>
            <a class='btn btn-link btn-lg' href="{{ site.baseurl }}/api.html">API</a>
          </li>
          <li>
            <a class='btn btn-link btn-lg' href="{{ site.baseurl }}/learn.html">Learn</a>
          </li>
          <li>
            <a class='btn btn-primary btn-lg' href="{{ site.baseurl }}/download.html">Download <strong>v{{ site.version }}</strong></a>
          </li>
        </ul>

      </div>

    </header>
    {% if page.url != "/" %}
      <div class="band band-inverse">

        <div class="container">

          <h1 class="margin-bottom-none">{{ page.title }}</h1>
          {% if page.edit != false %}
            <span class="h1 margin-bottom-none">
              {% include edit_button.html %}
            </span>
          {% endif %}
          {% if page.sub_title %}
            <h4>{{ page.sub_title}}</h4>
          {% endif %}

        </div>

      </div>
    {% endif %}

    <div role="main">
      {{ content }}
    </div>

    <div class="band">

      <div class="container">

        <div class="row">

          <div class="col-xs-4 col-md-offset-0 col-md-2">
            <a
              href="https://bsky.app/profile/pouchdb.bsky.social"
              target="_blank"
              rel="noopener noreferrer"
            >
              <img
                class="icon"
                src="{{ site.baseurl}}/static/img/friends/bluesky.svg"
                alt="PouchDB's Bluesky"
              />
            </a>
          </div>

          <div class="col-xs-4 col-md-offset-0 col-md-2">
            <a
              href="https://fosstodon.org/@pouchdb"
              target="_blank"
              rel="noopener noreferrer"
            >
              <img
                class="icon"
                src="{{ site.baseurl}}/static/img/friends/mastodon.svg"
                alt="PouchDB's Mastodon"
              />
            </a>
          </div>

          <div class="col-xs-4 col-md-2">
            <a
              href="https://github.com/rvagg/node-levelup"
              target="_blank"
              rel="noopener noreferrer"
            >
              <img
                class="icon"
                src="{{ site.baseurl}}/static/img/friends/leveldb.svg"
                alt="Node Levelup"
              />
            </a>
          </div>

          <div class="col-xs-4 col-md-2">
            <a
              href="https://github.com/apache/pouchdb"
              target="_blank"
              rel="noopener noreferrer"
            >
              <img
                class="icon"
                src="{{ site.baseurl}}/static/img/friends/github.svg"
                alt="PouchDB's Github Repo"
              />
            </a>
          </div>

          <div class="col-xs-4 col-md-2">
            <a
              href="http://couchdb.apache.org/"
              target="_blank"
              rel="noopener noreferrer"
            >
              <img
                class="icon"
                src="{{ site.baseurl }}/static/img/friends/couchdb.svg"
                alt="CouchDB"
              >
            </a>
          </div>

        </div>

      </div>

    </div>

    <footer class="band band-inverse">

      <div class="container">

        <div class="row">

          <div class="col-sm-3">
            <h3 class="nav-head">Learn</h3>
            <ul class="nav nav-silent">
              <li><a href="{{ site.baseurl }}/getting-started.html">Getting Started</a></li>
              <li><a href="{{ site.baseurl }}/api.html">API Guide</a></li>
              <li><a href="https://github.com/apache/pouchdb/wiki">Wiki</a></li>
            </ul>
          </div>

          <div class="col-sm-3">
            <h3 class="nav-head">Discuss</h3>
            <ul class="nav nav-silent">
              <li><a href="https://bsky.app/profile/pouchdb.bsky.social">Bluesky</a></li>
              <li><a href="https://fosstodon.org/@pouchdb">Mastodon</a></li>
              <li><a href="https://github.com/apache/pouchdb/discussions">GitHub Discussions</a></li>
              <li><a href="https://join.slack.com/t/couchdb/shared_invite/zt-3aqucllea-C92fkzW5oO_VhllRCqFbcw">Slack</a></li>
              <li><a href="http://stackoverflow.com/questions/tagged/pouchdb">StackOverflow</a></li>
            </ul>
          </div>

          <div class="col-sm-3">
            <h3 class="nav-head">Contribute</h3>
            <ul class="nav nav-silent">
              <li><a href="https://github.com/apache/pouchdb/blob/master/CONTRIBUTING.md">Contributing</a></li>
              <li><a href="https://github.com/apache/pouchdb">Source</a></li>
              <li><a href="https://github.com/apache/pouchdb/issues">Issues</a></li>
              <li><a href="https://github.com/apache/pouchdb/blob/master/LICENSE">Apache License</a></li>
              <li><a href="https://lists.apache.org/list.html?dev@pouchdb.apache.org">Dev Mailing List</a></li>
            </ul>
          </div>

        </div>

      </div>

    </footer>
    <script type="text/javascript" src="https://code.jquery.com/jquery.min.js"></script>
    <script type="text/javascript" src="https://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="{{ site.baseurl }}/static/js/code.min.js"></script>
    <script type="text/javascript" src="{{ site.baseurl }}/static/js/stickyfill.min.js"></script>
    <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/pouchdb/dist/pouchdb.min.js"></script>
    <script type="text/javascript">
      var $navSidebarWrapper = $('.nav-sidebar-wrapper');
      if ($navSidebarWrapper.length) {
        $navSidebarWrapper.Stickyfill();
      }
      $('[data-toggle="tooltip"]').tooltip();
      function onCached(e) {
        if (applicationCache.status === 1) {
          giveIntro();
        }
      }

      function giveIntro() {
        console.log('%c\n..............................................................................\n.?I...........~+: ............................................................\n.???.........++++.............................................................\n:????+......+++++.............................................................\n.??????+++++++++:.................................H...........D..B............\n...????++++++++...................................H...........D..B............\n...=????++++++.......PPPPP...OOOO...U....U...CCCC.HHHHH...DDDDD..BBBBB........\n...?????+++++++......P...:P.OO...O..U....U..C.....H...H..D....D..B....B.......\n..???????+++++++ ....P. ..P.O....O..U....U.CC.....H...H..D....D..B....B.......\n..?????????????......P...:P.OO...O..U....U..C.....H...H..D....D..B....B.......\n...I??????????~......PPPPP...OOOO...=UUUUU...CCCC.H...H...DDDDD..BBBBB........\n....?????????~.......P.... ...................................................\n.....???????+........P........................................................\n......??????..................................................................\n..............................................................................\n..............................................................................\n..............................................................................', 'color: #4ec084');
        console.log('%c\nPouchDB itself is hosted at PouchDB.com!\nTo get started, try typing:\nvar db = new PouchDB(\'mydb\');', 'color: #4ec084');
      }
      function offerToReload() {
        $('.js-update-notification')
          .removeClass('btn-update-hidden')
          .on('click', function(){
            window.location.reload();
          });
      }
      if (navigator.serviceWorker) {
        navigator.serviceWorker.register('{{ site.baseurl }}/serviceWorker.js')
          .then(function (registration) {
            registration.addEventListener('updatefound', function () {
              var newWorker = registration.installing;
              registration.installing.addEventListener('statechange', function () {
                if (newWorker.state == 'installed' && navigator.serviceWorker.controller) {
                  offerToReload();
                }
              });
            });
            giveIntro();
          })
          .catch(function(error) {
            console.log('ServiceWorker registration failed: ', error);
          });
      } else if (window.applicationCache) {
        applicationCache.addEventListener('cached', onCached, false);
        applicationCache.addEventListener('noupdate', giveIntro, false);
        applicationCache.addEventListener('updateready', offerToReload, false);
      }
    </script>
    <button type="button" class="js-update-notification btn btn-primary btn-update btn-update-hidden">
      Content updated, reload now? ↻
    </button>
  </body>
</html>
